Week 2 - Blink Using OS
bsp.h
Go to the documentation of this file.
1 /**************************************************
2  * Texas A&M University
3  * Electronic Systems Engineering Technology
4  * ENTC-489 Embedded Real Time Software Development
5  * Author: willey
6  * File: bsp.h
7  **************************************************/
12 #ifndef _bsp_H
13 #define _bsp_H
14 
15 #include <stdint.h>
16 #include <stdbool.h>
17 #include "inc/tm4c123gh6pm.h"
18 #include "driverlib/rom.h"
19 #include "driverlib/sysctl.h"
20 #include "driverlib/gpio.h"
21 #include "inc/hw_memmap.h"
22 #include "inc/hw_types.h"
23 #include "inc/hw_gpio.h"
24 
25 /**************************************************/
42 /**************************************************/
43 
44 /**************************************************/
72 #define CPU_50MHZ_CLOCK (SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_SYSDIV_4)
73 #define CPU_80MHZ_CLOCK (SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_SYSDIV_2_5)
74 
75 #define MILLI_HZ_PER_HZ (1000L)
76 #define MILLI_HZ_PER_KHZ (1000L * MILLI_HZ_PER_HZ)
77 
78 #define LAUNCH_GPIO_PORT (SYSCTL_PERIPH_GPIOF)
79 #define BOOST_GPIO_PORT (SYSCTL_PERIPH_GPIOD)
80 #define LAUNCH_OUTPUT_MASK (GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3)
81 #define BOOST_OUTPUT_MASK (GPIO_PIN_2)
82 #define LAUNCH_GPIO_BASE (GPIO_PORTF_BASE)
83 #define BOOST_GPIO_BASE (GPIO_PORTD_BASE)
84 
85 #define BLUE_LED_PIN (GPIO_PIN_2)
86 #define RED_LED_PIN (GPIO_PIN_1)
87 #define GREEN_LED_PIN (GPIO_PIN_3)
88 #define YELLOW_LED_PIN (GPIO_PIN_2)
89 
90 #define RGB_LED_MASK (GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3)
91 
92 #define LAUNCH_OUTPUT_DATA (HWREG(LAUNCH_GPIO_BASE + (GPIO_O_DATA + (LAUNCH_OUTPUT_MASK << 2))))
93 #define BOOST_OUTPUT_DATA (HWREG(BOOST_GPIO_BASE + (GPIO_O_DATA + (BOOST_OUTPUT_MASK << 2))))
94 
95 void init_gpio(void);
96 
97 /**************************************************/
102 #endif
103 
void init_gpio(void)
Definition: bsp.c:26